﻿package problemfactories;

import helpers.NotImplementedException;
import problems.diningphilosophers.philosopherssolution.*;

public class DiningPhilosophersFactory implements IProblemFactory<AbstractDiningPhilosophersSolution>
{
    private int nbPhilosophers;

    public DiningPhilosophersFactory(int nbPhilosophers)
    {
        this.nbPhilosophers = nbPhilosophers;
    }

    @Override
    public AbstractDiningPhilosophersSolution getSolution()
    {
        return new DiningPhilosophersWithLeftHandedRightHandedSolution(nbPhilosophers);
    }

    @Override
    public AbstractDiningPhilosophersSolution getSolutionWithDeadlock()
    {
        return new DiningPhilosophersWithDeadLock(nbPhilosophers);
    }

    @Override
    public AbstractDiningPhilosophersSolution getSolutionWithRaceCondition() throws NotImplementedException
    {
        throw new NotImplementedException();
    }

    @Override
    public AbstractDiningPhilosophersSolution getSolutionWithDatarace() throws NotImplementedException
    {
        throw new NotImplementedException();
    }
}